package inet.app.model.util;

import inet.app.R;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.widget.ProgressBar;
import android.widget.TextView;

public class ProgressDialog extends Dialog {
	private ProgressBar mProgress;
	// private int mProgressStatus = 0;
	private TextView message;
	private String strMessage;

	public Handler mHandler = new Handler();
	public Context context;

	public ProgressDialog(Context context, String strMessage) {
		super(context);
		this.context = context;
		this.strMessage = strMessage;
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setBackgroundDrawableResource(android.R.color.transparent);
		// setCancelable(false);
	}

	public ProgressDialog(Context context) {
		super(context);
		this.context = context;
		this.strMessage = "Đang tải";
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setBackgroundDrawableResource(android.R.color.transparent);
		// setCancelable(false);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_progress);

		message = (TextView) findViewById(R.id.progressDialogMessage);
		message.setText(strMessage);

		mProgress = (ProgressBar) findViewById(R.id.progress_bar);
		mProgress.getIndeterminateDrawable().setColorFilter(
				Color.parseColor("#EEEEEE"),
				android.graphics.PorterDuff.Mode.MULTIPLY);
	}

	public void onDismiss() {
		this.dismiss();
	}

}
